﻿using System.Collections.Generic;
using System.Linq;
using Common.Objects.Enums;
using EYCmsAdmin.Domain.Models;
using EYCmsAdmin.Presentation.Models.BaseModels;

namespace EYCmsAdmin.Presentation.Models.UserModels
{
    public class UserLoginModel : BasePresentationModel
    {
        public UserLoginModel(User user)
        {
            Roles = user.Roles.Select(x => (Roles) x.Id).ToList();
            Login = user.Login;
            Permissions = user.Permissions.Select(x => (Permissions) x.Id).ToList();
        }

        public IList<Permissions> Permissions { get; set; }

        public IList<Roles> Roles { get; set; }

        public string Login { get; set; }
    }
}